<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<title> NewPrjTutorialEclipse &lt; Mundo &lt; Foswiki</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="alternate" href="http://127.0.0.1/foswiki/bin/edit/Mundo/NewPrjTutorialEclipse?t=1295995542" type="application/x-wiki" title="edit NewPrjTutorialEclipse" />
<meta name="TEXT_NUM_TOPICS" content="Number of topics:" />
<meta name="TEXT_MODIFY_SEARCH" content="Modify search" />
<meta name="robots" content="noindex" /><link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/foswiki/bin/view/Mundo/WebRss" />
<style type="text/css" media="all">
@import url('style/base.css');
</style>
<style type="text/css" media="all">
@import url('style/layout.css');
@import url('style/style.css');
@import url('style/colors.css');
</style>
<style type="text/css" media="all">
@import url('style/column_left.css');
@import url('style/variant_foswiki_noframe.css');
</style><style type="text/css" media="all">
	/* Styles that are set using variables */
	.patternBookView .foswikiTopRow,
	.patternWebIndicator a img,
	.patternWebIndicator a:hover img {
		background-color:#efefef;
	}
	#patternTopBarContents { background-image:url(/foswiki/pub/System/PatternSkin/header5.gif); background-repeat:repeat-x;}
#patternTopBarContents { background-color:#ffffff;}
.patternBookView {
	border-color:#efefef;
}
.patternPreviewPage #patternMain {
	/* uncomment to set the preview image */
	/*background-image:url("/foswiki/pub/System/PreviewBackground/preview2bg.gif");*/
}
</style>
<style type="text/css" media="all">
@import url('style/print.css');
</style>
<!--[if IE]><style type="text/css" media="screen">
pre {
	height:1%;
	overflow-x:auto;
}
.foswikiAttachments,
.foswikiForm,
.foswikiHelp,
.foswikiPreviewArea,
.patternPreviewPage .foswikiForm,
.patternSigLine,
.patternToolBar,
.patternTop,
.patternTopicAction,
#patternSideBarContents .patternLeftBarPersonal,
#patternSideBarContents h2,
#patternSideBarContents li,
#patternTopBarButtons ul {
	height:1%;
}
#patternSideBarContents .patternLeftBarPersonal {
	width:100%;
}
.foswikiFormStep {
	height:100%;
}
#foswikiLogin,
.patternShadow {
	border:10px solid #fff;
	margin-top:10px;
	margin-bottom:10px;
	border:2px solid #ccc;
}
</style><![endif]-->
<!--[if gt IE 8 ]><style type="text/css" media="screen">
#foswikiLogin,
.patternShadow {
	border:10px solid #fff;
	margin-top:10px;
	margin-bottom:10px;
	box-shadow: 0 0 10px #ccc;
}
</style><![endif]-->
<meta name="foswiki.TWISTYANIMATIONSPEED" content="fast" /><!--TWISTYPLUGIN::META-->
<style type="text/css" media="all">
.foswikiTable {border-width:1px}
.foswikiTable .tableSortIcon img {padding-left:.3em; vertical-align:text-bottom}
.foswikiTable td {border-style:solid none; vertical-align:top}
.foswikiTable th {border-style:none solid; vertical-align:top; background-color:#d6d3cf; color:#000000}
.foswikiTable th a:link {color:#000000}
.foswikiTable th a:visited {color:#000000}
.foswikiTable th a:hover {color:#000000; background-color:#d6d3cf}
.foswikiTable th.foswikiSortedCol {background-color:#c4c1ba}
.foswikiTable tr.foswikiTableRowdataBg0 td {background-color:#ffffff}
.foswikiTable tr.foswikiTableRowdataBg0 td.foswikiSortedCol {background-color:#f7f7f6}
.foswikiTable tr.foswikiTableRowdataBg1 td {background-color:#f7f7f6}
.foswikiTable tr.foswikiTableRowdataBg1 td.foswikiSortedCol {background-color:#f0f0ee}
</style><!--TABLEPLUGIN_default-->
<style type="text/css" media="all">
.foswikiTable#tableNewPrjTutorialEclipse1 td {border-style:solid none; vertical-align:middle; vertical-align:top}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol0 {text-align:center}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol1 {text-align:left}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol2 {text-align:left}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol3 {text-align:right}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol4 {text-align:left}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol5 {text-align:left}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol6 {text-align:left}
.foswikiTable#tableNewPrjTutorialEclipse1 td.foswikiTableCol7 {text-align:center}
.foswikiTable#tableNewPrjTutorialEclipse1 th {border-style:solid none; vertical-align:middle; background-color:#ffffff; color:#0066cc}
.foswikiTable#tableNewPrjTutorialEclipse1 th a:link {color:#0066cc}
.foswikiTable#tableNewPrjTutorialEclipse1 th a:visited {color:#0066cc}
.foswikiTable#tableNewPrjTutorialEclipse1 th a:hover {color:#0066cc; background-color:#ffffff}
.foswikiTable#tableNewPrjTutorialEclipse1 th.foswikiSortedCol {background-color:#eeeeee}
.foswikiTable#tableNewPrjTutorialEclipse1 tr.foswikiTableRowdataBg0 td {background-color:#ffffff}
.foswikiTable#tableNewPrjTutorialEclipse1 tr.foswikiTableRowdataBg0 td.foswikiSortedCol {background-color:#f5f5f5}
</style><!--TABLEPLUGIN_specific-->
<meta name="foswiki.PUBURL" content="http://127.0.0.1/foswiki/pub" /> <!-- PUBURL -->
<meta name="foswiki.PUBURLPATH" content="/foswiki/pub" /> <!-- PUBURLPATH -->
<meta name="foswiki.SCRIPTSUFFIX" content="" /> <!-- SCRIPTSUFFIX -->
<meta name="foswiki.SCRIPTURL" content="http://127.0.0.1/foswiki/bin" /> <!-- SCRIPTURL -->
<meta name="foswiki.SCRIPTURLPATH" content="/foswiki/bin" /> <!-- SCRIPTURLPATH -->
<meta name="foswiki.SERVERTIME" content="25%20Jan%202011%20-%2023:45" /> <!-- SERVERTIME -->
<meta name="foswiki.SKIN" content="pattern" /> <!-- SKIN -->
<meta name="foswiki.SYSTEMWEB" content="System" /> <!-- SYSTEMWEB -->
<meta name="foswiki.TOPIC" content="NewPrjTutorialEclipse" /> <!-- TOPIC -->
<meta name="foswiki.USERNAME" content="guest" /> <!-- USERNAME -->
<meta name="foswiki.USERSWEB" content="Main" /> <!-- USERSWEB -->
<meta name="foswiki.WEB" content="Mundo" /> <!-- WEB -->
<meta name="foswiki.WIKINAME" content="WikiGuest" /> <!-- WIKINAME -->
<meta name="foswiki.WIKIUSERNAME" content="Main.WikiGuest" /> <!-- WIKIUSERNAME -->
<meta name="foswiki.NAMEFILTER" content="%5b%5cs%5c*%3f~%5e%5c%24%40%25%60%22'%26%3b%7c%3c%3e%5c%5b%5c%5d%23%5cx00-%5cx1f%5d" /> <!-- NAMEFILTER --><!--JQUERYPLUGIN::FOSWIKI::META-->
<link rel='stylesheet' href='/foswiki/pub/System/TwistyPlugin/jquery.twisty.css?version=1.6.0' type='text/css' media='all' /><!--JQUERYPLUGIN::TWISTY: requires= missing ids: JavascriptFiles/foswikiPref-->
</head>
<body class="patternViewPage patternPrintPage">
<a name="PageTop"></a><div class="foswikiPage"><div id="patternScreen">
<div id="patternPageShadow">
<div id="patternPage">
<div id="patternOuter">
<div id="patternFloatWrap">
<div id="patternMain">
<div id="patternMainContents">
<div class="patternContent"><div class="foswikiTopic"> <h1><a name="Creating_a_New_Project_in_Eclipse"></a>  Creating a New Project in Eclipse </h1>
<p />
This tutorial shows how to create a new project in Eclipse with the correct build and configuration files.
<p />
<h2><a name="Creating_Eclipse_Projects"></a>  Creating Eclipse Projects </h2>
<p />
To create a project in Eclipse, perform the following steps:
<p />
Create a new <em>Java Project</em>. Make sure that you select: <em>Create separate source and output folders</em>:
<p />
<img alt="eclipse-new-java-project.png" height="704" src="images/eclipse-new-java-project.png" width="647" />
<p />
In the Source tab, select <em>Create new source folder</em> and name it <code>prep</code>:
<p />
<img alt="eclipse-prep.png" height="590" src="images/eclipse-prep.png" width="647" />
<p />
In the Libraries tab, select <em>Add External JARs</em>. Now add <code>lib/mundocore.jar</code>:
<p />
<img alt="eclipse-jar.png" height="618" src="images/eclipse-jar.png" width="647" />
<p />
Then expand the new entry, select <em>Source Attachment</em>, click <em>Edit</em>, and select <code>sources.zip</code> from the MundoCore distribution:
<p />
<img alt="eclipse-sources.png" height="707" src="images/eclipse-sources.png" width="652" />
<p />
Copy a buildfile template (e.g., <code>samples/buildfiles/standard-edition-application/build.xml</code>) into the main project directory. You can use drag&amp;drop, then select <em>copy files</em>:
<p />
<img alt="eclipse-buildfile.png" height="505" src="images/eclipse-buildfile.png" width="458" />
<p />
Also copy <code>build.properties</code> from the <code>config</code> folder to the main project directory.
<p />
Now open <code>build.xml</code> and edit a few settings:
<p />
<p />
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">&lt;project name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;NONAME&quot;</FONT></B><B><FONT COLOR="#A020F0"> default=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;runscript&quot;</FONT></B><B><FONT COLOR="#A020F0"> basedir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;.&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;property file=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;build.properties&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;property name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;main-class&quot;</FONT></B><B><FONT COLOR="#A020F0"> value=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;MAINCLASS&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
  ...</pre><!-- end SyntaxHighlightingPlugin -->
<p />
Change the <em>name of the project</em> and the <em>name of the main class</em>, e.g., to:
<p />
<p />
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">&lt;project name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;MyProject&quot;</FONT></B><B><FONT COLOR="#A020F0"> default=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;runscript&quot;</FONT></B><B><FONT COLOR="#A020F0"> basedir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;.&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;property file=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;build.properties&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;property name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;main-class&quot;</FONT></B><B><FONT COLOR="#A020F0"> value=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;Main&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
  ...</pre><!-- end SyntaxHighlightingPlugin -->
<p />
Now the build environment is set up. You can start the build process by selecting <code>build.xml</code> and <em>Run As &gt; Ant Build</em>.
<p />
<h2><a name="Notes"></a>  Notes </h2>
<p /> <ul>
<li> If you are building primarily with the compiler embedded in Eclipse, you should also change the default build target to <code>preprocess</code>. Running <code>build.xml</code> then only invokes the preprocessor and no other build steps. However, you may want run <code>build.xml</code> with target <code>runscripts</code> at least once, to get the run scripts for your application.
</li> <li> It is not necessary to run the preprocessor each and every time the program is compiled. However, it is important to re-run the preprocessor when metadata information, serializable classes, or remote interfaces change.
</div></div><!-- /patternContent-->
</div></div></div></div></div></div></div></div>
</body></html>
